<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>手机充值</title>
		<link rel="stylesheet" href="css/bootstrap.css" />
		<link rel="stylesheet" href="css/mobile.css" />
		<style type="text/css">
			a:hover{
				text-decoration: none;
			}
		</style>
		<title></title>
	</head>
	<body>
	<form action="wapPayServlet" method="post">
		<div class="mo">
			<a href="javascript:history.go(-1)"><img src="img/尖括号-左.png" /></a>
			<span>手机充值</span>
			<img src="img/记事本.png" />
		</div>
		
		<div class="point">
			<span>小邦提示:</span>
			<ol style="background-color: white;">
				<li>充值反赠充值金额的5%邦豆</li>
				<li>月初和月末充值到账会略有延误，敬请原谅</li>
			</ol>
		</div>
		<div class="phone">
			<input value="" class="random" name="orderNum" type="text" hidden>
			<div class="phonee">
				<input id="phone1" name="phone1" type="hidden" />
				<input type="text" value="${user.userPhone}" name="rPhone" id="phone"/>
				<div class="tu">
					<img src="img/电话本(1).png" />
				</div>
				<div class="tele">
						<span tabindex="1" class="one">50元电话费</span>
						<span tabindex="2" class="one">100元电话费</span>
				</div>
			</div>
			<div class="fong">
				<img src="img/电话机.png" />
				<p>服务热线：400-809-1233</p>
			</div>
			<div class="def">
				<p>实付款：<input id="total" name="total" type="hidden" /><span id="so"></span></p>
				<input type="submit" id="add" value="立即充值"/>
			</div>
		</div>
	</form>
	</body>
</html>
<script src="js/jquery-3.2.1.js"></script>
<script src="js/model.js"></script>
<script type="text/javascript">
	/*function order_add() {
		var button=document.getElementById("add");

		button.onclick=function () {
			$.ajax({
				url:"orderadd?userId=${user.userId}",
				data:"userId="+${user.userId},
				datatype:"text",
				success:{

				},
				error:function () {
					alert("失败");
				}
			})
		}
	}
	order_add();*/

	function runStr(digit){
		if(digit=="" || isNaN(digit)){
			alert("请输入数字");
		}else{
			var sourceStr="0,1,2,3,4,5,6,7,8,9";
			arrStr=sourceStr.split(",");
			var result=""; //定义变量并初始化
			var index=0;
			for(i=0;i<digit;i++){
				index=parseInt(Math.random()*arrStr.length);
				result+=arrStr[index];
			}
			$(".random").val(result);
		}

	}
	runStr(9);
</script>

